import 'package:flutter/material.dart';
import 'package:flutter_application_1/utils/source_utils.dart';

class PriceWidget extends StatefulWidget {
  final String price;

  PriceWidget({
    this.price = '',
  });

  @override
  _PriceWidgetState createState() => _PriceWidgetState();
}

class _PriceWidgetState extends State<PriceWidget> {
  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Container(
          height: 16,
          margin: EdgeInsets.symmetric(vertical: 3),
          padding: EdgeInsets.only(
            left: 24,
            right: 6,
          ),
          alignment: Alignment.center,
          decoration: BoxDecoration(
            color: Color.fromRGBO(255, 237, 109, 1),
            border: Border.all(
              color: Color.fromRGBO(163, 104, 24, 1),
              width: 1,
              style: BorderStyle.solid,
            ),
            borderRadius: BorderRadius.circular(15),
          ),
          child: Text(
            widget.price,
            style: TextStyle(
              color: Color.fromRGBO(163, 104, 24, 1),
              height: 1,
              fontSize: 12,
            ),
          ),
        ),
        // 笑脸
        Container(
          width: 22,
          height: 22,
          decoration: BoxDecoration(
            color: Colors.white,
            border: Border.all(
              color: Color.fromRGBO(163, 104, 24, 1),
              width: 1,
              style: BorderStyle.solid,
            ),
            borderRadius: BorderRadius.circular(22),
          ),
          alignment: Alignment.center,
          child: Image.asset(
            ImageUtils.wrapAssets('smile-icon.png'),
            width: 16,
            height: 16,
          ),
        ),
      ],
    );
  }
}
